<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>商品页面</title>


		<link th:href="@{/static/assets/css/admin.css}" rel="stylesheet" type="text/css" />
		<link th:href="@{/static/assets/css/amazeui.css}" rel="stylesheet" type="text/css" />
		<link th:href="@{/static/basic/css/demo.css}" rel="stylesheet" type="text/css" />
		<link type="text/css" th:href="@{/static/css2/optstyle.css}" rel="stylesheet" />
		<link type="text/css" th:href="@{/static/css2/style.css}" rel="stylesheet" />
		<script type="text/javascript" th:src="@{/static/basic/js/jquery-1.7.min.js}"></script>
		<script type="text/javascript" th:src="@{/static/basic/js/quick_links.js}"></script>
		<script type="text/javascript" th:src="@{/static/assets/js/amazeui.js}"></script>
		<script type="text/javascript" th:src="@{/static/js2/jquery.imagezoom.min.js}"></script>
		<script type="text/javascript" th:src="@{/static/js2/jquery.flexslider.js}"></script>
		<script type="text/javascript" th:src="@{/static/js2/list.js}"></script>

	</head>

	<body>


	<div class="am-container header">
		<ul class="message-l">
			<div class="topMessage">
				<div class="menu-hd">
					<a href="/login1/login" target="_top" class="h">亲，请登录</a>
					<a href="/login1/enroll" target="_top">免费注册</a>
				</div>
			</div>
		</ul>
		<ul class="message-r">
			<div class="topMessage home">
				<div class="menu-hd"><a href="/user/main" target="_top" class="h">省多多商城</a></div>
			</div>
			<div th:onclick="myAccount([[${userPhone}]])" class="topMessage my-shangcheng">
				<div class="menu-hd MyShangcheng"><a target="_top"><i class="am-icon-user am-icon-fw"></i>[[${userPhone}]]</a></div>
			</div>
			<div class="topMessage mini-cart">
				<div class="menu-hd"><a id="mc-menu-hd" href="/cart/list" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
			</div>
			<div class="topMessage favorite">
				<div class="menu-hd"><a href="/myOrder/list" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>我的订单</span></a></div>
			</div>
		</ul>
	</div>

			<!--悬浮搜索框-->


	<!--悬浮搜索框-->

	<div class="nav white">
		<div class="logo"><img th:src="@{/static/images2/logo.png}" /></div>
		<div class="logoBig">
			<li><img th:src="@{/static/images2/logobig.png}"/></li>
		</div>
		<div class="search-bar pr">
			<a name="index_none_header_sysc" href="#"></a>
			<form action="search.html">
				<input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
				<input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
			</form>
		</div>
	</div>
	<div class="clear"></div>
	<b class="line"></b>
	<div class="listMain">
				<!--分类-->
		 <div class="nav-table">
			<div class="long-title"><span class="all-goods">商品购买</span></div>
			<div class="nav-cont">
				<ul>
					<li class="index"><a href="#">省</a></li>
					<li class="qc"><a href="#">多</a></li>
					<li class="qc"><a href="#">多</a></li>
					<li class="qc"><a href="#">商</a></li>
					<li class="qc last"><a href="#">城</a></li>
				</ul>
			</div>
		 </div>
		<ol class="am-breadcrumb am-breadcrumb-slash">
			<li><a href="#">首页</a></li>
			<li><a href="#">分类</a></li>
			<li class="am-active">内容</li>
		</ol>
				<script type="text/javascript">
					$(function() {});
					$(window).load(function() {
						$('.flexslider').flexslider({
							animation: "slide",
							start: function(slider) {
								$('body').removeClass('loading');
							}
						});
					});
				</script>
		<div class="scoll">
			<section class="slider">
				<div class="flexslider">
					<ul class="slides">
						<li>
							<img th:src="'http://localhost:8887/'+${obj.imgUrl}" title="pic" />
						</li>
					</ul>
				</div>
			</section>
		</div>

				<!--放大镜-->

				<div class="item-inform">
					<div class="clearfixLeft" id="clearcontent">

						<div class="box">
							<script type="text/javascript">
								$(document).ready(function() {
									$(".jqzoom").imagezoom();
									$("#thumblist li a").click(function() {
										$(this).parents("li").addClass("tb-selected").siblings().removeClass("tb-selected");
										$(".jqzoom").attr('src', $(this).find("img").attr("mid"));
										$(".jqzoom").attr('rel', $(this).find("img").attr("big"));
									});
								});
							</script>

							<div class="tb-booth tb-pic tb-s310">
								<a href="#"><img th:src="'http://localhost:8887/'+${obj.imgUrl}" alt="细节展示放大镜特效" th:rel="'http://localhost:8887/'+${obj.imgUrl}" class="jqzoom" /></a>
							</div>
							<ul class="tb-thumb" id="thumblist">
								<li class="tb-selected">
									<div class="tb-pic tb-s40">
										<a href="#"><img  th:src="'http://localhost:8887/'+${obj.imgUrl}" th:mid="'http://localhost:8887/'+${obj.imgUrl}" th:big="'http://localhost:8887/'+${obj.imgUrl}"></a>
									</div>
								</li>
							</ul>
						</div>

						<div class="clear"></div>
					</div>

					<div class="clearfixRight">

						<!--规格属性-->
						<!--名称-->
						<div class="tb-detail-hd">
								<h1 th:text="${obj.goodsName}"></h1>
						</div>
						<div class="tb-detail-list">
							<!--价格-->
							<div class="tb-detail-price">
								<li class="price iteminfo_price">
									<dt>促销价</dt>
									<dd><em>¥</em><b class="sys_item_price">[[${obj.goodsPrice}]]</b>  </dd>
								</li>
								<li class="price iteminfo_mktprice">
									<dt>原价</dt>
									<dd><em>¥</em><b class="sys_item_mktprice"><span th:text="${obj.goodsPrice}+3"></span></b></dd>
								</li>
								<div class="clear"></div>
							</div>
							<!--各种规格-->
							<dl class="iteminfo_parameter sys_item_specpara">
								<dt class="theme-login"><div class="cart-title">可选规格<span class="am-icon-angle-right"></span></div></dt>
								<dd>
									<!--操作页面-->

									<div class="theme-popover-mask"></div>

									<div class="theme-popover">
										<div class="theme-span"></div>
										<div class="theme-poptit">
											<a href="javascript:;" title="关闭" class="close">×</a>
										</div>
										<div class="theme-popbod dform">
											<form class="theme-signin" name="loginform" action="" method="post">
												<div class="theme-signin-left">
													<div class="theme-options">
														<div class="cart-title number">数量</div>
														<dd>
															<input id="min" class="am-btn am-btn-default" name="" type="button" value="-" />
															<input id="text_box" name="" type="text" value="1" style="width:30px;" />
															<input id="add" class="am-btn am-btn-default" name="" type="button" value="+" />
															<span id="Stock" class="tb-hidden">库存<span class="stock" th:text="${obj.goodsCount}"></span>件</span>
														</dd>
													</div>
													<div class="clear"></div>
												</div>
											</form>
										</div>
									</div>

								</dd>
							</dl>
							<div class="clear"></div>

						</div>

						<div class="pay">

							<li>
								<div class="clearfix tb-btn tb-btn-buy theme-login">
									<a id="LikBuy" title="点此按钮到下一步确认购买信息" href="#" th:onclick="createOrder([[${obj.id}]])">立即购买</a>
								</div>
							</li>
							<li>
								<div class="clearfix tb-btn tb-btn-basket theme-login">
									<a id="LikBasket" title="加入购物车" href="#" th:onclick="addCart([[${obj.id}]])"><i></i>加入购物车</a>
								</div>
							</li>
						</div>

					</div>

					<div class="clear"></div>

				</div>
				<!-- introduce-->
				<div class="introduce">
					<div class="introduceMain">
						<div class="am-tabs" data-am-tabs>
							<ul class="am-avg-sm-3 am-tabs-nav am-nav am-nav-tabs">
								<li class="am-active">
									<a href="#">
										<span class="index-needs-dt-txt">宝贝详情</span></a>
								</li>
								<li>
									<a href="#">
										<span class="index-needs-dt-txt">全部评价</span></a>
								</li>
								<li>
									<a href="#">
										<span class="index-needs-dt-txt">猜你喜欢</span></a>
								</li>
							</ul>
							</div>
						</div>
						<div class="clear"></div>
					</div>
				</div>
			</div>
	</body>
<script>
 function myAccount(userPhone){
    window.location.href = "/user/myAccount?userPhone="+userPhone;
    }
	    <!--购买创建订单-->
    function   createOrder(goodsId){
    var buyCount=$("#text_box").val();
   window.location.href="/so/createOrder?goodsId="+goodsId+"&buyCount="+buyCount;
    }
       <!--加入购物车-->
    function addCart(goodsId){
     var buyCount=$("#text_box").val();
    $.ajax({
     url: "/cart/add",
     data: {"goodsId":goodsId,"buyCount":buyCount},
     type: "post",
     success:function(info){
     if(info=="1"){
     alert("加入购物车成功");
     }else{
       alert("加入购物车失败");
     }

     }

    });
    }
</script>

</html>